Method and apparatus for adjusting orientation, and electronic device

ABSTRACT

This application relates to the field of display technologies, and provides a method and an apparatus for adjusting an orientation, and an electronic device. The method comprises: in response to a first rotation operation performed by a user on an electronic device, determining an orientation of content displayed on the screen of the electronic device; after the user performs the first rotation operation on the electronic device, determining whether an orientation of the screen is consistent with the orientation of the content; and in response to that after the user performs the first rotation operation on the electronic device, the orientation of the screen is consistent with the orientation of the content, maintaining the orientation of the content. By using the method, the apparatus, and the electronic device provided in embodiments of the present invention, content displayed on the electronic device can be adjusted to an orientation suitable for a user to view, and the user does not need to perform a specified gesture or enter an edit interface to perform a rotation operation, thereby simplifying a user operation and improving user experience.

TECHNICAL FIELD

This application relates to the field of display technologies, and inparticular, to a method and an apparatus for adjusting an orientation,and an electronic device.

BACKGROUND

As electronic devices are popularized, electronic devices are almostused by people in work, study, and entertainment every day. Electronicdevice manufacturers have always sought to enable users to operateelectronic devices more conveniently and quickly.

For example, many electronic devices are provided with a function ofautomatically rotating a screen. When this function is enabled, if amode in which a user operates an electronic device changes fromlandscape to portrait, as shown in FIG. 1, an interface of anapplication (APP) or an interface of an operating system operated by theuser currently automatically changes from a landscape layout to aportrait layout, to cause that the user performs an operation andcontrol conveniently, and vice versa.

In this case, an orientation of content that is being displayed such asan electronic reading that is being read, Internet content that is beingviewed, or a video that is being watched on the electronic device is notadjusted, still as shown in FIG. 1. As a result, an original orientationis always maintained for the content that is being displayed on theelectronic device, and it cannot be ensured that the orientation ischanged as the electronic device rotates, and that user experience isnot affected.

Therefore, if the original orientation of the content displayed on theelectronic device is abnormal, as shown in FIG. 2, the orientation ofthe displayed content cannot be rectified regardless of how theelectronic device is rotated.

In a traditional operation manner, a user needs to enter an editinterface, and click on and select an option such as “rotate”, to adjustthe orientation of the displayed content, or as shown in FIG. 3, a userneeds to slide on the screen of the electronic device to form aspecified gesture, to correspondingly adjust the orientation.

In the foregoing two operation manners, the former requires a relativelycomplex operation, and moreover, if an APP has no edit function, anorientation cannot be adjusted; the latter requires a user to learn andknow a specified gesture in advance, and moreover, when an electronicdevice is held by using a single hand, it is very difficult to input aspecified gesture.

SUMMARY

An objective of this application is to provide a method and an apparatusfor adjusting an orientation, and an electronic device.

According to a first aspect of at least one embodiment of thisapplication, a method for adjusting an orientation is provided, whereinthe method comprises:

in response to a first rotation operation performed by a user on anelectronic device, determining an orientation of content displayed onthe screen of the electronic device;

after the user performs the first rotation operation on the electronicdevice, determining whether an orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device; and

in response to that after the user performs the first rotation operationon the electronic device, the orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device, maintaining theorientation of the content displayed on the screen of the electronicdevice.

According to a second aspect of at least one embodiment of thisapplication, an apparatus for adjusting an orientation is provided,wherein the apparatus comprises:

a first determining module, configured to: in response to a firstrotation operation performed by a user on an electronic device,determine an orientation of content displayed on the screen of theelectronic device;

a second determining module, configured to: after the user performs thefirst rotation operation on the electronic device, determine whether anorientation of the screen of the electronic device is consistent withthe orientation of the content displayed on the screen of the electronicdevice; and

a first adjustment module, configured to: in response to that after theuser performs the first rotation operation on the electronic device, theorientation of the screen of the electronic device is consistent withthe orientation of the content displayed on the screen of the electronicdevice, maintain the orientation of the content displayed on the screenof the electronic device.

According to a third aspect of at least one embodiment of thisapplication, an electronic device is provided, wherein the electronicdevice comprises a memory and a processor, the memory is configured tostore an instruction, and the processor is configured to execute theinstruction, to perform the following steps:

in response to a first rotation operation performed by a user on anelectronic device, determining an orientation of content displayed onthe screen of the electronic device;

after the user performs the first rotation operation on the electronicdevice, determining whether an orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device; and

in response to that after the user performs the first rotation operationon the electronic device, the orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device, maintaining theorientation of the content displayed on the screen of the electronicdevice.

In the method and the apparatus for adjusting an orientation, and theelectronic device in the embodiments of this application, according towhether an orientation of a screen of an electronic device is consistentwith an orientation of content displayed on the screen of the electronicdevice after a user performs a first rotation operation on theelectronic device, the orientation of the content displayed on thescreen of the electronic device is flexibly adjusted. Content displayedon the electronic device can be adjusted to an orientation suitable fora user to view, and the user does not need to perform a specifiedgesture or enter an edit interface to perform a rotation operation,thereby simplifying a user operation and improving user experience.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of a display interface of an electronicdevice when the electronic device changes from landscape to portrait ina traditional case;

FIG. 2 is a schematic diagram of a display interface of an electronicdevice when the electronic device changes from landscape to portrait inanother traditional case;

FIG. 3 is a schematic diagram showing that a user adjusts an orientationby using a gesture;

FIG. 4 is a flowchart of a method for adjusting an orientation accordingto an embodiment of this application;

FIG. 5 is a schematic diagram of a display interface of an electronicdevice when the electronic device changes from landscape to portrait ina method for adjusting an orientation is used according to an embodimentof this application;

FIG. 6 is a flowchart of a method for adjusting an orientation accordingto another embodiment of this application;

FIG. 7a is a flowchart of a method for adjusting an orientationaccording to another embodiment of this application;

FIG. 7b is a flowchart of a method for adjusting an orientationaccording to another embodiment of this application;

FIG. 8 is a schematic diagram showing that an electronic device rotatesaround a direction of the electronic device according to an embodimentof this application;

FIG. 9 is a schematic structural diagram of modules of an apparatus foradjusting an orientation according to an embodiment of this application;

FIG. 10 is a schematic structural diagram of modules of an apparatus foradjusting an orientation according to another embodiment of thisapplication;

FIG. 11 is a schematic structural diagram of modules of an apparatus foradjusting an orientation according to still another embodiment of thisapplication;

FIG. 12 is a schematic structural diagram of modules of an apparatus foradjusting an orientation according to still another embodiment of thisapplication; and

FIG. 13 is a schematic structural diagram of an electronic deviceaccording to an embodiment of this application.

DETAILED DESCRIPTION

Specific implementation manners of the present application are furtherdescribed in detail with reference to accompanying drawings andembodiments. The following embodiments are used to describe thisapplication, but are not intended to limit the scope of thisapplication.

A person skilled in the art understands that sequence numbers of thefollowing steps do not mean execution sequences in embodiments of thisapplication. The execution sequences of the steps should be determinedaccording to functions and internal logic of the steps, and should notbe construed as any limitation on the implementation processes of theembodiments of this application.

Moreover, terminologies such as “first” and “second” in this applicationare used only to distinguish different steps, devices, modules, and thelike; and indicate neither a particular technical meaning nor aninevitable logical sequence thereof.

FIG. 4 is a flowchart of a method for adjusting an orientation accordingto an embodiment of this application, wherein the method may beimplemented on, for example, an electronic device. As shown in FIG. 4,the method may comprise:

S100: In response to a first rotation operation performed by a user onan electronic device, determine an orientation of content displayed onthe screen of the electronic device.

S120: After the user performs the first rotation operation on theelectronic device, determine whether an orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device.

S140: In response to that after the user performs the first rotationoperation on the electronic device, the orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device, maintain theorientation of the content displayed on the screen of the electronicdevice.

In the method for adjusting an orientation in this embodiment of thisapplication, according to whether an orientation of a screen of anelectronic device is consistent with an orientation of content displayedon the screen of the electronic device after a user performs a firstrotation operation on the electronic device, the orientation of thecontent displayed on the screen of the electronic device is flexiblyadjusted. Content displayed on the electronic device can be adjusted toan orientation suitable for a user to view, and the user does not needto perform a specified gesture or enter an edit interface to perform arotation operation, thereby simplifying a user operation and improvinguser experience.

In the example of the scenario shown in FIG. 2, after the electronicdevice rotates, the content displayed on the screen of the electronicdevice also correspondingly rotates. In a traditional solution,regardless of how the electronic device is rotated, an orientation ofdisplayed content is unsuitable for a user. However, by using the methodfor adjusting an orientation in this embodiment of this application,after a user rotates the screen of the electronic device, the contentdisplayed on the screen of the electronic device is temporarily notrotated, and when it is determined that the orientation of the screen ofthe rotated electronic device is consistent with the originalorientation of the content, the content displayed on the screen does notneed to be rotated, which finally improves user experience, as shown inFIG. 5.

Exemplarily, in this embodiment of this application, the electronicdevice comprises but is not limited to: a mobile phone, a personaldigital assistant (Full name in English: Personal Digital Assistant, PDAfor short), a tablet computer, and the like.

Optionally, as shown in FIG. 6, after S120, the method may furthercomprise:

S160: In response to that after the user performs the first rotationoperation on the electronic device, the orientation of the screen of theelectronic device is inconsistent with the orientation of the contentdisplayed on the screen of the electronic device, perform a secondrotation operation on the content displayed on the screen of theelectronic device.

In an optional implementation manner, a direction of the first rotationoperation may be contrary to a direction of the second rotationoperation. For example, a user rotates the electronic device by 90degrees counterclockwise in the first rotation operation, and discoversthat content displayed on the electronic device is not adjusted to anorientation suitable for watching as expected; therefore, the secondrotation operation may be performed on the content displayed on thescreen of the electronic device, for example, the content displayed onthe screen of the electronic device is rotated by 90 degrees clockwise,or rotated by 180 degrees clockwise, or rotated by 270 degreesclockwise.

Certainly, this embodiment of this application is not limited to thiscase. In another optional implementation manner, alternatively, thedirection of the first rotation operation may be the same as thedirection of the second rotation operation. For example, a user rotatesthe electronic device by 90 degrees counterclockwise in the firstrotation operation, and discovers that content displayed on theelectronic device is not adjusted to an orientation suitable forwatching as expected; therefore, the second rotation operation may beperformed on the content displayed on the screen of the electronicdevice, for example, the content displayed on the screen of theelectronic device is rotated by 90 degrees counterclockwise, or rotatedby 180 degrees counterclockwise, or rotated by 270 degreescounterclockwise.

As shown in FIG. 7a , in another optional implementation manner of thisapplication, the determining an orientation of content displayed on thescreen of the electronic device in S100 may comprise:

S100-A: According to a characteristic of the content displayed on thescreen of the electronic device, determine the orientation of thecontent displayed on the screen of the electronic device.

Exemplarily, a characteristic of at least a part of the contentdisplayed on the screen of the electronic device may be extracted, andthe orientation of the content displayed on the screen of the electronicdevice is determined according to the extracted characteristic.

For example, if the content displayed on the screen of the electronicdevice is a picture of a person, the picture of the person or a part ofthe picture of the person may be processed and analyzed, to extract acharacteristic area or a characteristic point, to recognize anorientation of the picture of the person. For example, it may bedetermined whether the picture of the person is longitudinal ortransverse according to a line that connects the two eyes of the pictureof the person, and a position of the nose of the picture of the person.

As shown in FIG. 7b , in another optional implementation manner of thisapplication, the determining an orientation of content displayed on thescreen of the electronic device in S100 may comprise:

S100-B: According to an identifier of the orientation of the contentdisplayed on the screen of the electronic device, determine theorientation of the content displayed on the screen of the electronicdevice.

Exemplarily, when acquiring content (for example, taking a photo orrecording a video) with cameras, some electronic devices may record anorientation of the content by using one or more identifiers; and anorientation of the content displayed on the screen of the electronicdevice may be determined subsequently according to the orientationidentifiers as needed.

For example, a reference direction may be determined in advance, forexample, may be a longitudinal direction, and the orientation identifiermay comprise information such as “an included angle between thereference direction and the orientation of the content in a clockwisedirection or in a counterclockwise direction”, as shown in Table 1.

TABLE 1 Rotation operation Orientation Included angle between areference identifier Direction direction and content Identifier 1Counterclockwise 180 degrees  Identifier 2 Counterclockwise 90 degreesIdentifier 3 Clockwise 90 degrees

In an actual application, a variation range between −α and +α may beallowed for the included angle, for example, the included angle isactually 80 degrees in a clockwise direction, however, if an error of 10degrees is within the allowed variation range, it can still beconsidered that an orientation identifier corresponds to the identifier3. α may be a default value, or may be set according to an actual case.If an error within a relatively large range can be tolerated, α may beset to a slightly large value, for example, ±10 degrees; and if arequirement on preciseness is relatively high, α may be set to aslightly small value, for example, ±5 degrees, or may even be set to 0degree.

Optionally, in an embodiment of this application, a position of theelectronic device may be detected according to a sensor in theelectronic device. For example, as shown in FIG. 8, if it is detectedthat the electronic device rotates around a normal direction (normaldirection) of the electronic device, it may be determined that a userperforms the first rotation operation on the electronic device.

Exemplarily, the sensor comprises but is not limited to: a gravityacceleration sensor or a camera (Camera).

FIG. 9 is a schematic structural diagram of modules of an apparatus foradjusting an orientation according to an embodiment of this application.The apparatus for adjusting an orientation may be an electronic devicesuch as a mobile phone, a PDA, a tablet computer, or a camera, or may beone or more chips, a partial circuit, or one or more functional modulesin an electronic device. As shown in FIG. 9, the apparatus 900 foradjusting an orientation may comprise:

a first determining module 910, configured to: in response to a firstrotation operation performed by a user on an electronic device,determine an orientation of content displayed on the screen of theelectronic device;

a second determining module 920, configured to: after the user performsthe first rotation operation on the electronic device, determine whetheran orientation of the screen of the electronic device is consistent withthe orientation of the content displayed on the screen of the electronicdevice; and

a first adjustment module 930, configured to: in response to that afterthe user performs the first rotation operation on the electronic device,the orientation of the screen of the electronic device is consistentwith the orientation of the content displayed on the screen of theelectronic device, maintain the orientation of the content displayed onthe screen of the electronic device.

In the apparatus for adjusting an orientation in this embodiment of thisapplication, according to whether an orientation of a screen of anelectronic device is consistent with an orientation of content displayedon the screen of the electronic device after a user performs a firstrotation operation on the electronic device, the orientation of thecontent displayed on the screen of the electronic device is flexiblyadjusted. Content displayed on the electronic device can be adjusted toan orientation suitable for a user to view, and the user does not needto perform a specified gesture or enter an edit interface to perform arotation operation, thereby simplifying a user operation and improvinguser experience.

Referring to FIG. 10, in an optional implementation manner, theapparatus 900 for adjusting an orientation may further comprise:

a second adjustment module 940, configured to: in response to that afterthe user performs the first rotation operation on the electronic device,the orientation of the screen of the electronic device is inconsistentwith the orientation of the content displayed on the screen of theelectronic device, perform a second rotation operation on the contentdisplayed on the screen of the electronic device.

In an optional implementation manner, as shown in FIG. 11, the firstdetermining module 910 may further comprise:

a first determining unit 911, configured to: according to acharacteristic of the content displayed on the screen of the electronicdevice, determine the orientation of the content displayed on the screenof the electronic device; and/or

a second determining unit 912, configured to: according to an identifierof the orientation of the content displayed on the screen of theelectronic device, determine the orientation of the content displayed onthe screen of the electronic device.

Referring to FIG. 12, in an optional implementation manner, theapparatus 900 for adjusting an orientation may further comprise:

a sensing module 950, configured to detect a position of the electronicdevice; and

a transmission module 960, configured to: in response to that it isdetected that the electronic device rotates around a normal direction(normal direction) of the electronic device, transmit a detection resultto the first determining module 910.

Optionally, the sensor 950 may comprise a gravity acceleration sensor ora camera.

Referring to FIG. 13, another embodiment of this application provides anelectronic device 1300. Referring to FIG. 13, the electronic device 1300may comprise:

a processor (processor) 1310 and a memory (memory) 1330.

The memory 1330 is configured to store an instruction, and the processor1310 is configured to execute the instruction, to perform the followingsteps:

in response to a first rotation operation performed by a user on anelectronic device, determining an orientation of content displayed onthe screen of the electronic device;

after the user performs the first rotation operation on the electronicdevice, determining whether an orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device; and

in response to that after the user performs the first rotation operationon the electronic device, the orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device, maintaining theorientation of the content displayed on the screen of the electronicdevice.

It may be clearly understood by a person skilled in the art that, forthe purpose of a convenient and brief description, for specific workingprocesses of the apparatus for adjusting an orientation and theelectronic device described above, reference may be made tocorresponding process descriptions in the method for adjusting anorientation in the foregoing method embodiment, which are not describedherein again.

In conclusion, by using the electronic device in this embodiment of thisapplication, according to whether an orientation of a screen of anelectronic device is consistent with an orientation of content displayedon the screen of the electronic device after a user performs a firstrotation operation on the electronic device, the orientation of thecontent displayed on the screen of the electronic device is flexiblyadjusted. Content displayed on the electronic device can be adjusted toan orientation suitable for a user to view, and the user does not needto perform a specified gesture or enter an edit interface to perform arotation operation, thereby simplifying a user operation and improvinguser experience.

A person of ordinary skill in the art may be aware that, the exemplaryunits and method steps described in the embodiments disclosed in thisspecification may be implemented by electronic hardware, or acombination of computer software and the electronic hardware. Whetherthe functions are performed by hardware or software depends onparticular applications and design constraint conditions of thetechnical solutions. A person skilled in the art may use differentmethods to implement the described functions for each particularapplication, but the implementation should not be construed as exceedingthe scope of the present application.

When the functions are implemented in a form of a software functionalunit, and are sold or used as an independent product, the functions maybe stored in a computer readable storage medium. Based on such anunderstanding, the technical solutions of this application essentially,or the part contributing to the prior art, or a part of the technicalsolutions may be implemented in a form of a software product. Thecomputer software product is stored in a storage medium and comprisesseveral instructions for instructing a computer device (which may be apersonal computer, a controller, a network device, or the like) toperform all or a part of the steps of the method described in theembodiment of this application. The foregoing storage medium comprisesany medium that can store program code, such as a USB flash drive, aremovable hard disk, a read-only memory (Read-Only Memory, ROM), arandom access memory (Random Access Memory, RAM), a magnetic disk, or anoptical disc.

The foregoing implementation manners are only used for describing thepresent application, and are not intended to limit the presentapplication. A person of ordinary skill in the art may make variouschanges and variations without departing from the spirit and scope ofthe present application; therefore, any equivalent technical solutionfalls within the scope of the present application, and patent protectionscope of the present application shall be defined by claims.

What is claimed is:
 1. A method for adjusting an orientation,comprising: capturing an image or video by an electronic device; inresponse to a first rotation operation of the electronic device, inwhich an orientation of content of the image or video displayed on ascreen of the electronic device is rotated according to a direction ofthe first rotation operation, determining the orientation of the contentdisplayed on the screen of the electronic device; determining whether anorientation of the screen of the electronic device is consistent withthe orientation of the content displayed on the screen of the electronicdevice; and in response to determining that the orientation of thescreen of the electronic device is consistent with the orientation ofthe content displayed on the screen of the electronic device,maintaining the orientation of the content displayed on the screen ofthe electronic device, wherein the determining the orientation of thecontent displayed on the screen of the electronic device comprises:determining the orientation of the content displayed on the screen ofthe electronic device according to an identifier of the orientation ofthe content displayed on the screen of the electronic device, whereinone or more identifiers of the orientation of the content are recordedwhen capturing the image or video, and the one or more identifiersindicate an included angle between a reference direction and theorientation of the content in a clockwise direction or in acounterclockwise direction, wherein the reference direction is apredetermined direction.
 2. The method of claim 1, further comprising:in response to that after the first rotation operation of the electronicdevice, the orientation of the screen of the electronic device isinconsistent with the orientation of the content displayed on the screenof the electronic device, performing a second rotation operation on thecontent displayed on the screen of the electronic device.
 3. The methodof claim 2, wherein the direction of the first rotation operation is thesame as or contrary to a direction of the second rotation operation. 4.The method of claim 1, further comprising: before the determining theorientation of content displayed on the screen of the electronic device,determining that a user performs the first rotation operation on theelectronic device.
 5. The method of claim 4, wherein the determiningthat the user performs the first rotation operation on the electronicdevice comprises: detecting, according to a sensor in the electronicdevice, a rotation of the electronic device around a normal direction ofthe electronic device, and determining the first rotation operation ofthe electronic device.
 6. The method of claim 5, wherein the sensorcomprises: a gravity acceleration sensor or a camera.
 7. An electronicdevice, comprising a memory and a processor, wherein the memory isconfigured to store an instruction, and the processor is configured toexecute the instruction, to perform operations including: capturing animage or video; in response to a first rotation operation of theelectronic device, in which an orientation of content of the image orvideo displayed on a screen of the electronic device is rotatedaccording to a direction of the first rotation operation, determiningthe orientation of the content displayed on the screen of the electronicdevice; determining whether an orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device; and in response todetermining that the orientation of the screen of the electronic deviceis consistent with the orientation of the content displayed on thescreen of the electronic device, maintaining the orientation of thecontent displayed on the screen of the electronic device, wherein thedetermining the orientation of the content displayed on the screen ofthe electronic device comprises: determining the orientation of thecontent displayed on the screen of the electronic device according to anidentifier of the orientation of the content displayed on the screen ofthe electronic device, wherein one or more identifiers of theorientation of the content are recorded when capturing the image orvideo, and the one or more identifiers indicate an included anglebetween a reference direction and the orientation of the content in aclockwise direction or in a counterclockwise direction, wherein thereference direction is a predetermined direction.
 8. The electronicdevice of claim 7, wherein the operations further comprise: detecting aposition of the electronic device.
 9. The electronic device of claim 8,further comprising: a gravity acceleration sensor or a camera.
 10. Theelectronic device of claim 7, wherein the operations further comprise:in response to that after the first rotation operation of the electronicdevice, the orientation of the screen of the electronic device isinconsistent with the orientation of the content displayed on the screenof the electronic device, performing a second rotation operation on thecontent displayed on the screen of the electronic device.
 11. The methodof claim 1, wherein the determining the orientation of the contentdisplayed on the screen of the electronic device comprises: extracting acharacteristic of at least a part of the content displayed on the screenof the electronic device, and determining the orientation of the contentdisplayed on the screen of the electronic device according to theextracted characteristic.
 12. The electronic device of claim 7, whereinthe operations further comprise: according to a characteristic of thecontent displayed on the screen of the electronic device, determiningthe orientation of the content displayed on the screen of the electronicdevice.